/*
 * @Description: 结算单详情table声明函数
 * @Autor: 何兴家
 * @Date: 2021-01-07 10:03:19
 * @LastEditors: 何兴家
 * @LastEditTime: 2021-03-01 17:13:00
 */

// 维修项目
export const createRepairLabourColumns = function() {
  return [
    {
      title: '序号',
      dataIndex: 'index',
      width: 80,
      sorter: true,
      render: (props, h) => {
        return <span>{props.row.index + 1}</span>;
      }
    },
    {
      title: '收费区分',
      dataIndex: 'CHARGE_PARTITION_CODE',
      sorter: true,
      filter: true,
      filterType: 'checkbox',
      filterItems: [],
      dictItems: []
    },
    {
      title: '项目维修类型',
      dataIndex: 'REPAIR_TYPE_CODE',
      sorter: true,
      filter: true,
      filterType: 'checkbox',
      filterItems: [],
      dictItems: []
    },
    {
      title: '项目代码',
      dataIndex: 'LABOUR_CODE',
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '项目名称',
      dataIndex: 'LABOUR_NAME',
      width: 200,
      sorter: true,
      filter: true,
      filterType: 'input',
      showOverflowTooltip: true
    },
    {
      title: '工时费',
      dataIndex: 'LABOUR_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'number'
    },
    {
      title: '派工工时',
      dataIndex: 'ASSIGN_LABOUR_HOUR',
      sorter: true,
      filter: true,
      filterType: 'number'
    },
    {
      title: '收费工时',
      dataIndex: 'STD_LABOUR_HOUR',
      sorter: true,
      filter: true,
      filterType: 'number'
    },
    {
      title: '优惠金额',
      dataIndex: 'DISCOUNT_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'number',
      precision: 2
    },
    {
      title: '折扣率',
      dataIndex: 'DISCOUNT',
      sorter: true,
      filter: true,
      filterType: 'number'
    },
    {
      title: '实收金额',
      dataIndex: 'CALC_REAL_RECEIVE_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'number',
      precision: 2
    },
    {
      title: '工时单价',
      dataIndex: 'LABOUR_PRICE',
      sorter: true,
      filter: true,
      filterType: 'number'
    },
    {
      title: '责任技师',
      dataIndex: 'TECHNICIAN',
      sorter: true,
      dictItems: [],
      // filter: true,
      // filterType: 'input',
      showOverflowTooltip: true
    },
    {
      title: '是否派工',
      dataIndex: 'ASSIGN_TAG',
      sorter: true,
      disabled: true,
      filter: true,
      filterType: 'checkbox',
      filterItems: this.createDictList(1004),
      dictItems: this.createDictList(1004)
    },
    {
      title: '是否增项',
      dataIndex: 'IS_ADDITION',
      sorter: true,
      disabled: false,
      filter: true,
      filterType: 'checkbox',
      filterItems: this.createDictList(1004),
      dictItems: this.createDictList(1004)
    },
    {
      title: '是否委外',
      dataIndex: 'CONSIGN_EXTERIOR',
      sorter: true,
      filter: true,
      filterType: 'checkbox',
      filterItems: this.createDictList(1004),
      dictItems: this.createDictList(1004)
    },
    // {
    //   title: '是否不修',
    //   dataIndex: 'NEEDLESS_REPAIR',
    //   sorter: true,
    //   filter: true,
    //   filterType: 'checkbox',
    //   filterItems: this.createDictList(1004),
    //   dictItems: this.createDictList(1004)
    // },
    // {
    //   title: '不修原因',
    //   dataIndex: 'REASON',
    //   sorter: true,
    //   filter: true,
    //   filterType: 'checkbox',
    //   filterItems: this.createDictList('8070'),
    //   dictItems: this.createDictList('8070')
    // },
    {
      title: '活动编号',
      dataIndex: 'ACTIVITY_CODE',
      sorter: true,
      filter: true,
      filterType: 'input',
      showOverflowTooltip: true
    },
    {
      title: '备注',
      dataIndex: 'REMARK',
      width: 280,
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '套餐代码',
      dataIndex: 'PACKAGE_CODE',
      sorter: true,
      filter: true,
      filterType: 'input',
      showOverflowTooltip: true
    }
  ];
};

// 维修配件
export const createRepairPartColumns = function() {
  return [
    {
      title: '序号',
      dataIndex: 'index',
      width: 80,
      sorter: true,
      render: (props, h) => {
        return <span>{props.row.index + 1}</span>;
      }
    },
    {
      title: '是否入账',
      dataIndex: 'IS_FINISHED',
      sorter: true,
      filter: true,
      filterType: 'checkbox',
      filterItmes: this.createDictList(1004),
      dictItems: this.createDictList(1004)
    },
    {
      title: '收费区分',
      dataIndex: 'CHARGE_PARTITION_CODE',
      sorter: true,
      filter: true,
      filterType: 'checkbox',
      filterItems: [],
      dictItems: []
    },
    {
      title: '仓库代码',
      dataIndex: 'STORAGE_CODE',
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '配件代码',
      dataIndex: 'PART_NO',
      sorter: true,
      showOverflowTooltip: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '配件名称',
      dataIndex: 'PART_NAME',
      sorter: true,
      filter: true,
      filterType: 'input',
      showOverflowTooltip: true
    },
    {
      title: '配件数量',
      dataIndex: 'PART_QUANTITY',
      sorter: true,
      filter: true,
      filterType: 'number'
    },
    {
      title: '配件销售单价',
      dataIndex: 'PART_SALES_PRICE',
      sorter: true,
      filter: true,
      filterType: 'number',
      precision: 2
    },
    {
      title: '配件销售金额',
      dataIndex: 'PART_SALES_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'input',
      precision: 2
    },
    {
      title: '折扣率',
      dataIndex: 'DISCOUNT',
      sorter: true,
      filter: true,
      filterType: 'number'
    },
    {
      title: '优惠金额',
      dataIndex: 'DISCOUNT_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'input',
      precision: 2
    },
    {
      title: '实收金额',
      dataIndex: 'CALC_REAL_RECEIVE_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'input',
      precision: 2
    },
    {
      title: '成本价',
      dataIndex: 'PART_COST_PRICE',
      sorter: true,
      filter: true,
      filterType: 'number',
      precision: 2
    },
    {
      title: '维修项目名称',
      dataIndex: 'LABOUR_CODE',
      sorter: true,
      filter: true,
      filterType: 'checkbox',
      filterItems: [],
      dictItems: []
    },
    {
      title: '主要配件',
      dataIndex: 'IS_MAIN_PART',
      sorter: true,
      editable: true,
      defaultEditable: true,
      disabled: true,
      editType: 'checkbox',
      editItems: [
        { text: '', trueValue: 10041001 },
        { text: '', falseValue: 10041002 }
      ]
    },
    {
      title: '不可打折',
      dataIndex: 'IS_DISCOUNT',
      sorter: true,
      filter: true,
      disabled: true,
      editItems: [
        { text: '', trueValue: '10041001' },
        { text: '', falseValue: '10041002' }
      ]
    },
    {
      title: '是否增项',
      dataIndex: 'IS_ADDITION',
      sorter: true,
      editable: true,
      defaultEditable: true,
      disabled: true,
      editType: 'checkbox',
      editItems: [
        { text: '', trueValue: '10041001' },
        { text: '', falseValue: '10041002' }
      ]
    },
    {
      title: '库位代码',
      dataIndex: 'STORAGE_POSITION_CODE',
      sorter: true
    },
    // {
    //   title: '是否不修',
    //   dataIndex: 'NEEDLESS_REPAIR',
    //   sorter: true,
    //   editable: true,
    //   defaultEditable: true,
    //   editType: 'checkbox',
    //   editItems: [
    //     { text: '', trueValue: '10041001' },
    //     { text: '', falseValue: '10041002' }
    //   ]
    // },
    // {
    //   title: '不修类型',
    //   dataIndex: 'REASON_TYPE',
    //   sorter: true,
    //   filter: true,
    //   filterType: 'checkbox',
    //   filterItems: this.createDictList('8070'),
    //   editable: true,
    //   defaultEditable: true,
    //   editType: 'select',
    //   editItems: this.createDictList('8070')
    // },
    // {
    //   title: '不修原因',
    //   dataIndex: 'REASON',
    //   sorter: true,
    //   filter: true,
    //   filterType: 'input',
    //   editable: true,
    //   defaultEditable: true,
    //   editType: 'input'
    // },
    {
      title: '流水号',
      dataIndex: 'BATCH_NO',
      sorter: true,
      filter: true,
      filterType: 'input',
      hidden: true,
      showOverflowTooltip: true
    },
    {
      title: '活动编号',
      dataIndex: 'ACTIVITY_CODE',
      sorter: true,
      filter: true,
      filterType: 'input',
      showOverflowTooltip: true
    },
    {
      title: '套餐代码',
      dataIndex: 'PACKAGE_CODE',
      sorter: true,
      filter: true,
      filterType: 'input',
      showOverflowTooltip: true
    }
  ];
};

// 附加项目
export const createAdditionItemColumns = function() {
  return [
    {
      title: '序号',
      dataIndex: 'index',
      width: 80,
      sorter: true,
      render: (props, h) => {
        return <span>{props.row.index + 1}</span>;
      }
    },
    {
      title: '收费区分',
      dataIndex: 'CHARGE_PARTITION_CODE',
      sorter: true,
      filter: true,
      filterType: 'checkbox',
      filterItems: [],
      dictItems: []
    },
    {
      title: '附加项目代码',
      dataIndex: 'ADD_ITEM_CODE',
      sorter: true,
      filter: true,
      filterType: 'input',
      showOverflowTooltip: true
    },
    {
      title: '附加项目名称',
      dataIndex: 'ADD_ITEM_NAME',
      sorter: true,
      filter: true,
      filterType: 'input',
      showOverflowTooltip: true
    },
    {
      title: '附加项目费',
      dataIndex: 'ADD_ITEM_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'input',
      showOverflowTooltip: true,
      precision: 2
    },
    {
      title: '优惠金额',
      dataIndex: 'DISCOUNT_AMOUNT',
      filter: true,
      filterType: 'input',
      sorter: true,
      showOverflowTooltip: true,
      precision: 2
    },
    {
      title: '折扣率',
      dataIndex: 'DISCOUNT',
      sorter: true,
      filter: true,
      filterType: 'input',
      showOverflowTooltip: true
    },
    {
      title: '实收金额',
      dataIndex: 'CALC_REAL_RECEIVE_AMOUNT',
      filter: true,
      filterType: 'input',
      sorter: true,
      showOverflowTooltip: true,
      precision: 2
    },
    {
      title: '备注',
      dataIndex: 'REMARK',
      filter: true,
      filterType: 'input',
      sorter: true,
      showOverflowTooltip: true
    }
  ];
};
// 销售配件
export const createSalesPartColumns = function() {
  return [
    {
      title: '序号',
      dataIndex: 'index',
      width: 80,
      sorter: true,
      render: (props, h) => {
        return <span>{props.row.index + 1}</span>;
      }
    },
    {
      title: '仓库代码',
      dataIndex: 'STORAGE_CODE',
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '库位代码',
      dataIndex: 'STORAGE_POSITION_CODE',
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '配件代码',
      dataIndex: 'PART_NO',
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '配件名称',
      dataIndex: 'PART_NAME',
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '电池序列号',
      dataIndex: 'BATTERY_SEQUENCE',
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '计量单位',
      dataIndex: 'UNIT_CODE',
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '配件销售数量',
      dataIndex: 'PART_QUANTITY',
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '配件销售单价',
      dataIndex: 'PART_SALES_PRICE',
      sorter: true,
      filter: true,
      filterType: 'input',
      precision: 2
    },
    {
      title: '成本价',
      dataIndex: 'PART_COST_PRICE',
      sorter: true,
      filter: true,
      filterType: 'input',
      precision: 2
    },
    {
      title: '配件销售金额',
      dataIndex: 'PART_SALES_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'input',
      precision: 2
    },
    {
      title: '优惠金额',
      dataIndex: 'DISCOUNT_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'input',
      precision: 2
    },
    {
      title: '折扣率',
      dataIndex: 'DISCOUNT',
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '实收金额',
      dataIndex: 'CALC_REAL_RECEIVE_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'number',
      precision: 2
    },
    {
      title: '是否入账',
      dataIndex: 'IS_FINISHED',
      sorter: true,
      filter: true,
      filterType: 'checkbox',
      filterItmes: this.createDictList(1004),
      dictItems: this.createDictList(1004)
    }
  ];
};
// 优惠券
export const createDiscountCouponColumns = function() {
  return [
    {
      title: '序号',
      dataIndex: 'index',
      width: 80,
      sorter: true,
      render: (props, h) => {
        return <span>{props.row.index + 1}</span>;
      }
    },
    {
      title: '操作',
      dataIndex: 'operation',
      render: (props, h) => {
        return (
          <div>
            <el-button type="text">同步</el-button>
            <el-button type="text">删除</el-button>
          </div>
        );
      }
    },
    {
      title: '优惠券代码',
      dataIndex: 'code',
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '优惠券名称',
      dataIndex: 'name',
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '优惠券类型',
      dataIndex: 'type',
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '优惠金额',
      dataIndex: 'amount',
      sorter: true,
      filter: true,
      filterType: 'input',
      precision: 2
    },
    {
      title: '是否已使用',
      dataIndex: 'used',
      sorter: true,
      filter: true,
      filterType: 'input'
    }
  ];
};
// 应收
export const createReceivableColumns = function() {
  return [
    {
      title: '序号',
      dataIndex: 'index',
      width: 80,
      sorter: true,
      render: (props, h) => {
        return <span>{props.row.index + 1}</span>;
      }
    },
    {
      title: '收费对象代码',
      dataIndex: 'PAYMENT_OBJECT_CODE',
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '收费对象名称',
      dataIndex: 'PAYMENT_OBJECT_NAME',
      showOverflowTooltip: true,
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '应收工时费',
      dataIndex: 'RECEIVEABLE_LABOUR_FEE',
      sorter: true,
      filter: true,
      filterType: 'number',
      precision: 2
    },
    {
      title: '应收维修材料费',
      dataIndex: 'RECEIVEABLE_REPAIR_PART_FEE',
      sorter: true,
      filter: true,
      filterType: 'number',
      precision: 2
    },
    {
      title: '应收销售材料费',
      dataIndex: 'RECEIVEABLE_SALES_PART_FEE',
      sorter: true,
      filter: true,
      filterType: 'number',
      precision: 2
    },
    {
      title: '应收附加项目费',
      dataIndex: 'RECEIVEABLE_ADD_ITEM_FEE',
      sorter: true,
      filter: true,
      filterType: 'number',
      precision: 2
    },
    {
      title: '应收总金额',
      dataIndex: 'CALC_RECEIVEABLE_TOTAL_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'number',
      precision: 2
    }
  ];
};
// 实收
export const createRealIncomeColumns = function() {
  return [
    {
      title: '序号',
      dataIndex: 'index',
      width: 80,
      sorter: true,
      render: (props, h) => {
        return <span>{props.row.index + 1}</span>;
      }
    },
    {
      title: '收费对象代码',
      dataIndex: 'PAYMENT_OBJECT_CODE',
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '收费对象名称',
      dataIndex: 'PAYMENT_OBJECT_NAME',
      showOverflowTooltip: true,
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '实收工时费',
      dataIndex: 'REAL_LABOUR_FEE',
      precision: 2,
      sorter: true,
      filter: true,
      filterType: 'input'
    },
    {
      title: '实收维修材料费',
      dataIndex: 'REAL_REPAIR_PART_FEE',
      sorter: true,
      filter: true,
      filterType: 'input',
      precision: 2
    },
    {
      title: '实收销售材料费',
      dataIndex: 'REAL_SALES_PART_FEE',
      sorter: true,
      filter: true,
      filterType: 'input',
      precision: 2
    },
    {
      title: '实收附加项目费',
      dataIndex: 'REAL_ADD_ITEM_FEE',
      sorter: true,
      filter: true,
      filterType: 'input',
      precision: 2
    },
    // {
    //   title: '汇总金额',
    //   dataIndex: 'CALC_SUM_AMOUNT',
    //   sorter: true,
    //   filter: true,
    //   filterType: 'input',
    //   precision: 2
    // },
    {
      title: '实收总金额',
      dataIndex: 'CALC_REAL_TOTAL_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'input',
      precision: 2
    },
    {
      title: '税额',
      dataIndex: 'CALC_TAX_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'input',
      precision: 2
    },
    {
      title: '不含税金额',
      dataIndex: 'CALC_NET_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'input',
      precision: 2
    },
    {
      title: '去零金额',
      dataIndex: 'SUB_OBB_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'input',
      precision: 2
    },
    {
      title: '应收账款',
      dataIndex: 'CALC_RECEIVABLE_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'input',
      precision: 2
    },
    {
      title: '已收账款',
      dataIndex: 'RECEIVED_AMOUNT',
      width: 150,
      sorter: true,
      filter: true,
      filterType: 'number',
      precision: 2
    },
    {
      title: '未收账款',
      dataIndex: 'NOT_RECEIVED_AMOUNT',
      sorter: true,
      filter: true,
      filterType: 'number',
      precision: 2
    },
    {
      title: '是否结清',
      dataIndex: 'PAY_OFF',
      sorter: true,
      filter: true,
      filterType: 'checkbox',
      filterItems: this.createDictList('1004'),
      dictItems: this.createDictList('1004')
    },
    {
      title: '是否开票',
      dataIndex: 'INVOICE_TAG',
      sorter: true,
      filter: true,
      filterType: 'checkbox',
      filterItems: this.createDictList('1004'),
      dictItems: this.createDictList('1004')
    }
  ];
};
